package com.sumainfor.pc.gmio.controller.MktFeign;

import com.sumainfor.common.util.FieldCheckUtil;
import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.gmio.service.impl.market.KeepService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 功能描述:
 * 管家评价
 * @Auther: zhlu
 * @Date: 2019/4/6 19:29
 * @Description:
 */
@RestController
@RequestMapping("/key/keep")
public class KeepController {

    @Autowired
    KeepService KeepService;

    /**
     * 功能描述:
     * 根据管家编号获取评价的分数，如果没有分数默认五分
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/4/6 19:31
     */
    @GetMapping("/getKeepAvgRangeMap")
    public JsonResult getKeepAvgRangeMap(@RequestParam Map<String,Object> params){
        JsonResult result=new JsonResult();
        if(!FieldCheckUtil.isMapFieldNotNull(params,new String[]{"SysUserId"})){
            result.putFailed("SysUserId不能为空！");
            return  result;
        }
        result.put(KeepService.getKeepAvgRangeMap(params));
        return result;
    }


}
